package com.tuanbiao.ui.upload;

import androidx.annotation.NonNull;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.tuanbiao.R;
import com.tuanbiao.data.entity.UploadServiceBean;

/**
 * @author abiao
 * @date 2022/5/20 10:17
 * @description:
 */
public class UploadDataDetailsServiceAdapter extends BaseQuickAdapter<UploadServiceBean, BaseViewHolder> {

    public UploadDataDetailsServiceAdapter() {
        super(R.layout.item_upload_data_service);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder holder, UploadServiceBean bean) {
        holder.setText(R.id.tv_name, bean.getService().getServiceName(bean.getService()));
        holder.setText(R.id.tv_status, bean.isSuccess() ? "成功" : "失败");
        holder.setBackgroundResource(R.id.ll_content, bean.isSuccess() ? R.drawable.bg_solid_success_r_2 : R.drawable.bg_solid_danger_r_2);
    }
}
